#include<stdio.h>
#define  N  15
void CaculateYH(int a[][N], int n);
void PrintYH(int a[][N], int n);
int main()
{	 	  	  
    int a[N][N] = {0}, n;
    printf("Input n(n<15):\n");
    scanf("%d", &n);              //1
    CaculateYH(a, n);             //2
    PrintYH(a, n);                //2
    return 0;
}	 	  	  
void CaculateYH(int a[][N], int n)//1
{	 	  	  
    int i, j;
    for (i = 0; i < n; i++)       //1
    {	 	  	  
        a[i][0] = 1;              //1
        a[i][i] = 1;              //1
    }
    for (i = 2; i < n; i++)       //1
    {	 	  	  
        for (j = 1; j <= i - 1; j++) //1
        {	 	  	  
            a[i][j] = a[i - 1][j - 1] + a[i - 1][j];//2
        }
    }
}	 	  	  
void PrintYH(int a[][N], int n)    //1
{	 	  	  
    int i, j;
    for (i = 0; i < n; i++)        //1
    {	 	  	  
        for (j = 0; j <= i; j++)   //1
        {	 	  	  
            printf("%5d", a[i][j]);//1
        }
        printf("\n");              //1
    }
}